MuleSoft Accelerators - Setup Guide icon

MuleSoft Accelerators - Setup Guide

(0 reviews)

Application deployment

This release simplifies the deployment of applications to CloudHub by leveraging Maven profiles to consolidate the required settings and credentials needed for all deployments. Additional profiles can also be created to support non-CloudHub deployments.

Configuring the deployment profile

The default settings-accelerators.xml file, provided by the "Accelerator Common Build" asset, defines a single deployment profile called CloudHub-DEV. The key properties that can be configured are described in the following table:

Property NameDescriptionMandatory
cloudhub.mavenServerIdMaven server entry providing credentials for target Anypoint instanceyes
cloudhub.regionTarget deployment regionyes
cloudhub.businessGroupIdID (not name) of the target business groupyes
cloudhub.environmentExact name of the target deployment environment (case-sensitive)yes
cloudhub.applicationNameConstructs the deployed application name from app/env propertiesyes
cloudhub.muleVersionTarget Mule runtime versionyes
cloudhub.applyLatestPatchSet to true to automatically apply latest patches on deploymentno
cloudhub.workerTypeWorker size (translates to vCores)yes
cloudhub.workersNumber of workersyes
cloudhub.objectStoreV2Set to true to use ObjectStore V2no
cloudhub.persistentQueuesSet true to use persistent queuesno
cloudhub.skipDeploymentVerificationSet to false to wait for application to be fully deployed before continuingno
cloudhub.deploymentTimeoutAmount of time (in milliseconds) to wait for complete application deploymentno
mule.environmentSpecifies the configuration properties files to useyes
mule.encryptionKeyIf secured properties are used an encryption key is requiredno
anypoint.platform.clientIdClient ID of the target environment or business groupyes
anypoint.platform.clientSecretClient secret of the target environment or business groupyes
anypoint.platform.enableMonitoringSet to true to enable monitoring and visualizationno

Application naming

The default setting for the cloudhub.applicationName property constructs the application name base on the following segments:

  • Global Prefix (default is none)
  • Maven artifact ID (from project pom.xml)
  • API compliance version (from project pom.xml)
  • Target environment name (hard-coded for profile)

An example of a deployed application name using the default settings is accel-notifications-prc-api-v1-dev.

Important note: Since CloudHub application names must be globally unique, it is highly recommended to set the global.cloudhub.appPrefix property (defined in the global-settings profile) to a short, 2-4 character abbreviation unique to your organization. Do not exceed 4 characters or deployments may fail (see below).

Deploying applications

Once appropriate values have been defined for the properties for the environment profile, individual applications can be deployed to that environment simply by specifying the profile name on the Maven command line. For example, the command mvn clean deploy -DskipTests -PCloudHub-DEV uses the settings in the CloudHub-DEV profile to build and deploy the application.

The common build project also includes some Maven configuration files to assist in deploying multiple applications - in the correct order - at once. To deploy all components of the MuleSoft Accelerator for Service Cloud, for example, you can run the following command from within the accelerator-common-build project directory:

mvn -f servicecloud-build-pom.xml clean package mule:deploy -DskipTests -PCloudHub-DEV

Important note: For the above command to work, you must have already downloaded the dependent projects, imported them into Studio, and renamed them according to the individual README.md files.

In this example, the following projects must be located in the Studio workspace as peers to the common build project:

  • accelerator-jira-sys-api
  • accelerator-oms-sys-api
  • accelerator-salesforce-odata-api
  • accelerator-salesforce-sys-api
  • accelerator-servicenow-sys-api
  • accelerator-case-prc-api
  • accelerator-customers-prc-api
  • accelerator-case-listener
  • accelerator-salesforce-topic-listener
  • accelerator-jira-exp-api
  • accelerator-salesforce-exp-api
  • accelerator-servicenow-exp-api

Use the given build configs as a starting point; you can always adjust the module references to suit your own needs.

Importing projects into Anypoint Studio

If you choose to import accelerator projects into Anypoint Studio, be aware that Studio may automatically make modifications to the application pom.xml files, which could impact deployment. In particular, be sure to cancel the prompt to "Upgrade your workspace" when importing projects. If you run into trouble, check the pom.xml file and verify the configuration of the mule-maven-plugin looks something like this:

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>mule-maven-plugin</artifactId>
    <extensions>true</extensions>
    <configuration>
        <cloudHubDeployment>
        ...
        </cloudHubDeployment>
        <classifier>${mule.app.classifier}</classifier>
    </configuration>
</plugin>

Make sure there is no <version> element included, and that the <classifier> element contains the property reference indicated above.

Troubleshooting

If deployment fails due to an unauthorized error, it is possible that the complete application name exceeds the 42 character limit on CloudHub deployment names. Adjust either the prefix, the artifactId value in the project pom.xml, or the deployment name pattern to ensure the complete application name does not exceed 42 characters in length.


Reviews

TypeCustom
OrganizationMulesoft
Published by
MuleSoft Organization
Published onDec 17, 2022
Asset overview

Asset versions for 2.0.x

Asset versions
VersionActions
2.0.1